package com.orders.commandFactory;

import com.orders.command.Command;
import com.orders.pojo.Customer;
import com.orders.pojo.User;

public abstract class AbstractCommandFactory {
	public abstract Command getCommandImp(String command);	
	
	public static AbstractCommandFactory getCommand(Object obj){
			if(obj instanceof User){
				User user = (User)obj;
				return new UserCommandFactory(user);
			}
			
			if(obj instanceof Customer){
				Customer customer = (Customer)obj;
				return new CustomerCommandFactory(customer);
			}
			return null;
		}
}
